package com.ae.shield.common.enchantment.shieldSuffix;

import net.minecraft.enchantment.Enchantment;

import javax.annotation.Nonnull;

public class Conservation extends SuffixBase {
    public Conservation() {
        super(new SuffixRate()
                .recovery(-0.1f, 1)
                .cd(0.1f, 1)
                .intensity(0.2f, 1)
                .cost(-0.1f, 1));
    }

    @Override
    public float levelRate(int level, SuffixProperty property, float rate) {
        switch (property) {
            case RECOVERY:
            case CD:
            case INTENSITY:
            case COST:
                return rate * level;
            default:
                return rate;
        }
    }

    @Override
    protected boolean canApplyTogether(@Nonnull Enchantment enchantment) {
        return enchantment != SuffixList.OVERCLOCK.get() && super.canApplyTogether(enchantment);
    }
}
